import request from '@/utils/request'
export default{
    saveCourseInfo(courseInfo){
        return request({
            url: '/eduservice/course/saveCourse',
            method: 'post',
            data: courseInfo
        })
    },
    teacherListInfo(){
        return request({
            url: '/eduservice/teacher/list',
            method: 'get'
        })
    }, 
    getAllSubject(){
        return request({
            url: '/eduservice/subject/getSubjectTree',
            method: 'get'
        })
    },
    getCourseInfo(courseId){
        return request({
            url: `/eduservice/course/getCourseInfo/${courseId}`,
            method: 'get'
        })
    },
    updateCourseInfo(courseInfo){
        return request({
            url: '/eduservice/course/updateCourse',
            method: 'post',
            data: courseInfo
        })
    },
    getCoursePublishInfoById(id) {
        return request({
          url: `/eduservice/course/course-publish-info/${id}`,
          method: 'get'
        })
      },
      
      publishCourse(id) {
        return request({
          url: `/eduservice/course/publish-course/${id}`,
          method: 'put'
        })
      },

      getPageList(page, limit, searchObj) {
        return request({
          url: `/eduservice/course/${page}/${limit}`,
          method: 'get',
          params: searchObj
        })
      },
      removeById(id) {
        return request({
            url: `/eduservice/course/${id}`,
            method: 'delete'
        })
    }
}